#include "BitmapSocketViaFile.h"
#include "BitmapSocketViaStream.h"
#include "BitmapSocketAdaptor.h"

#include <stdexcept>

#include <boost/shared_ptr.hpp>
#include <boost/shared_array.hpp>

boost::shared_ptr<BitmapSocketAdaptor> BitmapSocketAdaptorFactory::createAdaptor(
	const std::string& adaptorType) const
{
	if(adaptorType == "file")
	{
		return boost::shared_ptr<BitmapSocketAdaptor>(new BitmapSocketViaFile(L"screenTmp"));
	}
	else if (adaptorType == "stream")
	{
		return boost::shared_ptr<BitmapSocketAdaptor>(new BitmapSocketViaStream());
	}
	else 
	{
		throw std::invalid_argument("Type must be file or stream");
	}
}